package com.wyy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wyy.pojo.AppreciatesOrder;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: gytcb
 * @author: 吴磊
 * @create: 2021-06-26 14:32
 */
@Repository
public interface OrderMapper extends BaseMapper<AppreciatesOrder> {

    /**
     * 查询说有的订单
     *
     * @return
     */
    @Select("select * from appreciates_order")
    List<AppreciatesOrder> getAllOrder();

    /**
     * 根据订单Id删除订单
     *
     * @param orderId
     * @return
     */
    @Delete("delete from appreciates_order where order_id = #{orderId}")
    Integer deleteOrderByOrderId(@Param("orderId") String orderId);


    /**
     * 根据订单Id获取订单支付状态
     *
     * @param orderId
     * @return
     */
    Integer getOrderStatusByOrderId(@Param("orderId") String orderId);

    /**
     * 插入订单
     *
     * @param appreciatesOrder
     * @return
     */
    Integer insertOrder(AppreciatesOrder appreciatesOrder);

    /**
     * 更新订单状态
     *
     * @param appreciatesOrder
     * @return
     */
    Integer updateOrder(AppreciatesOrder appreciatesOrder);
}
